package com.jsmile.cloud.msgcenter.api.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmile.cloud.msgcenter.api.constants.MsgConstants;
import com.jsmile.cloud.msgcenter.api.req.ReqPayOrderCreate;
import com.jsmile.cloud.msgcenter.api.req.ReqPayOrderRefund;
import com.jsmile.cloud.tradecenter.api.req.ReqPayOrder;
import com.jsmile.mall.api.JSmileResult;

/**
 * @author 龚亮
 * @version 1.0
 * @desc 订单支付api
 * @date 2019年12月03日 08:30:39
 */
@FeignClient(value = MsgConstants.APPLICATION_NAME, contextId = "payOrder")
public interface PayOrderServiceApi {

    // TODO 创建支付订单
    @RequestMapping(value = "/feign/payOrder/create", method = RequestMethod.POST)
    JSmileResult create(@RequestBody @Valid ReqPayOrderCreate reqPayOrderCreate);

    // TODO 去支付
    @RequestMapping(value = "/feign/payOrder/toPay", method = RequestMethod.POST)
    JSmileResult toPay(@RequestBody @Valid ReqPayOrder reqPayOrder);

    @RequestMapping(value = "/feign/payOrder/refund", method = RequestMethod.POST)
    JSmileResult refund(@RequestBody @Valid ReqPayOrderRefund reqPayOrderRefund);
}
